package bd;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @author Camilo
 */
public class ConBdHsqldb {

    private static final String jdbcDriver = "org.hsqldb.jdbcDriver";
    private static final String caminho = "./bdbackup/bdbackup";
    private static final String jdbcUrl = "jdbc:hsqldb:file:" + caminho + ";shutdown=true";
    private static final String jdbcUser = "sa";
    private static final String jdbcPasswd = "";

    public static Connection getConexao() throws SQLException {
        try {
            Class.forName(jdbcDriver);
            Connection con = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPasswd);
            return con;
        } catch (ClassNotFoundException e) {
            throw new SQLException(e.getMessage());
        }
    }
}
//            Class.forName("net.sourceforge.jtds.jdbc.Driver");
////      return DriverManager.getConnection("jdbc:postgresql://localhost:5432/postgres","camilo","password");
//            return DriverManager.getConnection("jdbc:jtds:sqlserver://192.168.0.200:1433/CashSuper;"
//                    + "instance=SQLEXPRESS;user=sa;password=_ellus#35587_");